; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S %s | FileCheck %s

@glob = internal constant [5 x i8*] zeroinitializer, align 16

; Make sure simplifycfg does not crash when dealing with icmp constant
; expressions.
define i1 @test(i1 %c) {
; CHECK-LABEL: @test(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[SPEC_SELECT:%.*]] = select i1 [[C:%.*]], i1 false, i1 icmp ult (i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @glob, i64 0, i64 0), i8** inttoptr (i64 -40 to i8**))
; CHECK-NEXT:    ret i1 [[SPEC_SELECT]]
;
entry:
  br i1 %c, label %if.then, label %exit

if.then:
  br label %exit

exit:
  %p = phi i1 [ false, %if.then ], [ icmp ult (i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @glob, i64 0, i64 0), i8** inttoptr (i64 -40 to i8**)), %entry ]
  ret i1 %p
}
